package com.zy.demo;

import com.zy.constant.MqConstant;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.common.message.Message;
import org.junit.jupiter.api.Test;


public class OneWayTest {


    @Test
    public void batchTest() throws Exception {
        DefaultMQProducer producer = new DefaultMQProducer("one-way-producer-group");

        producer.setNamesrvAddr(MqConstant.NAMESRV_ADDR);

        producer.start();

        Message message = new Message("onewayTopic","one way msg".getBytes());

        producer.sendOneway(message);

        producer.shutdown();

    }
}
